home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / ScriptX / Documentation / Code Examples from Docs / compguid / printing / docprn / loadme.sx < prev    next >
Encoding:
Text File  |  1996-05-21  |  3.0 KB  |  93 lines  |  [TEXT/ttxt]

  1. --<<<-
  2. -- Filename:
  3. --     LOADME.SX
  4.  
  5. -- Other Files Required: 
  6. --     JAILBIRD.SX, MEDIA.SX
  7.  
  8. -- Purpose:
  9. --     Demonstrates a simple working document
  10.  
  11. -- Specialized Classes:
  12. --     None
  13.  
  14. -- Instructions to User:
  15. --     This is the script which will load all scripts needed to create the document.
  16. -- To create the titlecontainer, run the loadme.sx script.
  17. --
  18. --        When the jailbird.sxt title runs a window will appear with the title page.
  19. -- Click any where in this page to go to the next page.  Subsequent pages will
  20. -- contain forward and backward buttons for traversing the document.
  21.  
  22. -- Author:
  23. --     Kim Swix
  24. ------------------------------------------------------------------------
  25. -- *******************************************************************
  26. -- JailBirds - a small sample document
  27. -- Document is composed of two layouts and 4 pages.  One layout is the title page.
  28. -- The other the page for mugshots.
  29. -- All bitmaps are represented as persistentProxys so that they can be purged
  30. -- from memory when traversing from page to page.  Although, memory is not
  31. -- an issue in this example; it will be for "live" apps.
  32. --
  33. -- Directions for Use:
  34. --  1. To create the title container, load in the script loadme.sx.  This script will
  35. --     take care of loading in additional files.
  36. -- 
  37. -- Running the titleContainer:
  38. -- 1.  Either double click on the title container or choose Open from the file menu.
  39. -- 2.  Once the titleContainer is created, a title page will appear.  Click any
  40. --     where in the title page to go to the next page.  Subsequent pages will
  41. --     have arrows to move forwards and backwards.
  42. --- ********************************************************************
  43.  
  44.  
  45. -- ********************************************************************
  46. -- Define the titleContainer and the document module.
  47. -- ********************************************************************
  48. module docModule
  49.     uses ScriptX
  50. end
  51.  
  52. in module docModule
  53. global docCont := new titleContainer dir:theScriptDir path:"jailbird.sxt" \
  54.         targetcollection:(new hashtable)
  55.             
  56. global doc, MyDocumentClass, MyWindowClass
  57.  
  58. fileIn theScriptDir name:"docprint.sx"
  59. fileIn theScriptDir name:"media.sx"
  60. fileIn theScriptDir name:"jailbird.sx"
  61.  
  62.  
  63. -- This example causes the document to be built during startup.  For more lengthy apps., it
  64. -- would be better to have the document already built and in the window.  Save the window
  65. -- to the titleContainer.  That way on startup, the window is restored with doc already
  66. -- in it.
  67. function startMugs ->
  68. (  
  69.    local win := new MyWindowClass boundary:(new rect x2:300 y2:300) name:"JailBirds" title:thetitlecontainer
  70.  
  71.    win.y := 40
  72.    doc := makeDocument()
  73.    append win doc
  74.    forward doc
  75.    show win
  76.    return win
  77. )
  78.  
  79.  
  80. docCont.startupAction := (tc ->
  81.     if (not isdefined Printer) do (process (new loader) "loadable/printing")
  82.     
  83.     -- Enable the print menu item
  84.     enableitem theTitleContainer.systemMenuBar @print
  85.    
  86.     foreach tc load undefined
  87.     startMugs()
  88.     )
  89.  
  90. add docCont "startmugs"  startmugs    
  91. close docCont
  92. -->>>
  93.